<?php


class Log_Dao{

	function __construct(){
	}
	
	//mendapatkan seluruh data log berupa array 
	function get_all(){
		$sql="
		select *
		from
		log
		";
		
		$list_log = array();
		
		$data = mysql_query($sql);
		if($data){
			while($row = mysql_fetch_assoc($data)){
			
				$log = new Log();
				$log->id_log = $row['ID_LOG'];
				$log->id= $row['ID'];	
				$log->waktu= $row['WAKTU'];					
				$list_log[] = $log;
			}
		}	
		return $list_log;
	}

	
	//mendapatkan data log berupa array berdasarkan parameter id_log
	function get_id($id_log){
		$sql="
		select *
		from
		log
		WHERE
		ID_LOG = '".$id_log."'
		";
		
		$LOG=false;		
		$data = mysql_query($sql);
		if($data){
			while($row = mysql_fetch_assoc($data)){
				
				$log = new Log();
				$log->id_log = $row['ID_LOG'];
				$log->id= $row['ID'];	
				$log->waktu= $row['WAKTU'];	
			}
		}	
		return $log;
	}
	
	//mendapatkan seluruh data log satu member berupa array 
	function get_member($id){
		$sql="
		select *
		from
		log
		WHERE
		ID = '".$id."'
		";
		
		$list_log = array();
		
		$data = mysql_query($sql);
		if($data){
			while($row = mysql_fetch_assoc($data)){
			
				$log = new Log();
				$log->id_log = $row['ID_LOG'];
				$log->id= $row['ID'];	
				$log->waktu= $row['WAKTU'];					
				$list_log[] = $log;
			}
		}	
		return $list_log;
	}
	

}

class Log{
	var $id_log;
	var $id;
	var $waktu;

}